import {
  Controller,
  Get,
  Param,
  ParseIntPipe,
  Post,
  Body,
  Delete,
  Req,
  Put,
} from '@nestjs/common';
import { MenuService } from './menu.service';
import { warpperResponse } from '../../utils/index';
@Controller('menu')
export class MenuController {
  constructor(private readonly userService: MenuService) {}
  @Get('list')
  async getMenu() {
    return warpperResponse(this.userService.findeAll(), '获取菜单列表成功');
  }
  @Get('allList')
  async getMenuallList() {
    return warpperResponse(
      this.userService.getMenuallList(),
      '获取菜单列表成功',
    );
  }
  @Post('create')
  create(@Body() body) {
    return warpperResponse(this.userService.create(body), '添加菜单成功');
  }
  @Post('update')
  update(@Body() body) {
    return warpperResponse(this.userService.update(body), '添加菜单成功');
  }
}
